package com.qiang.testspecialview;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Toast;

public class MainActivity extends Activity implements RegularHexagonLayout.OnItemClickListener{

    private RegularHexagonLayout layout;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        layout = (RegularHexagonLayout) findViewById(R.id.specail_view);
        layout.setOnItemClickListener(this);

        //可以动态的给某个正六边形设置文本.
        RegularHexagonView childAt = (RegularHexagonView) layout.getChildAt(0);
        childAt.setDrawText("综合评价");
    }



    @Override
    public void onItemClick(RegularHexagonLayout parent, RegularHexagonView child, int positon) {
        Toast.makeText(this,"positon:"+positon,Toast.LENGTH_SHORT).show();
    }

}
